const app = getApp();
Page({
  data: {
    username:'',
    department:'',
    position:'',
    realname:'',
    header:'',
    messageShowRedDot:false,
    maskShow:false
  },
  onLoad: function (options) {
    var str = app.data.username,
    username = str.substr(0, 3) + "****" + str.substr(7);
    this.setData({
        username: username,
        department: app.data.department,
        position: app.data.position,
        realname: app.data.realname,
        header: app.data.header,
        messageShowRedDot: app.data.messageShowRedDot
    })
  },
  onShow(){
      this.onLoad()
  },
    exit:function(){
        this.setData({
            maskShow:true
        })
    },
    cancel:function(){
        this.setData({
            maskShow: false
        })
    },
    ConfirmExit:function(){
        wx.removeStorageSync('token');
        wx.removeStorageSync('openid')
        wx.redirectTo({
            url: '../login/login'
        })
    },
    SystemMessage:function(){
        wx.navigateTo({
            url: '../SystemMessage/SystemMessage',
        })
    }
})